<style>
body {
  height: 500px;
  width: 500px;
}
</style>
<script>
var eventTypes = ['mousemove', 'mousedown', 'mouseup', 'click'];
for (var i = 0; i < eventTypes.length; i++)
    document.addEventListener(eventTypes[i], parent.onEventInFrame);
</script>
